<?php
include("common/header.html");
include("/var/www/html/new/conf/yd.le.je");
$ydle=new yd_go_sql();
$ydle->connect(); 
include("../_made/le.cfg.php");
include("common/left.html");
include_once("/var/www/html/new/com.inc.php");
$topic=$_REQUEST['topic'];
$content=$_REQUEST['content'];
$time=date('Y-m-d H:i:s');

if($_REQUEST['action']=='保存'){
    if($topic!=""&&$content!=""){
		if(!p_match($topic)&&!p_match($content)){
			$sql="INSERT into uu_tra_route (topic,edit_date,content) values('$topic','$time','$content')";
			$GLOBALS['ydle']->query($sql);
			echo "<script>alert('保存成功!');parent.window.location=window.parent.location.href;</script>";
		}else{
			echo "<script>alert('输入不合法!');parent.window.location=window.parent.location.href;</script>";
		}
    }else{
        echo "<script>alert('标题或内容不能为空!');parent.window.location=window.parent.location.href;</script>";
    }
}else if($_REQUEST['action']=='发布'){
    if($topic!=""&&$content!=""){
		if(!p_match($topic)&&!p_match($content)){
			$sql="INSERT into uu_tra_route (topic,edit_date,content,status) values('$topic','$time','$content','1')";
			$GLOBALS['ydle']->query($sql);
			echo "<script>alert('发布成功!');parent.window.location=window.parent.location.href;</script>";
		}else{
			echo "<script>alert('发布失败!');parent.window.location=window.parent.location.href;</script>";
		}
}else{
    echo "<script>alert('内容或标题不能为空!');parent.window.location=window.parent.location.href;</script>";
}
}

?>
<!-- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<form action="#" method="post" name="form" enctype="multipart/form-data">
路线名称&nbsp;<input type="txt" name="topic" value="" /><br>
路线描述&nbsp;<textarea name="content" style=" height:20%;"></textarea>
<input  type="submit" id="Submit" name="action" value="保存"/>
<input  type="submit" id="Submit" name="action" value="发布"/>
</form> -->
<link rel="stylesheet" href="http://www.12301.cc/css/page.css" media="all">
<div class="r_content" id="bind_tao">
    <h3 class="mc_title">
        <span class="mctit_1"><span class="mctit_2">管理员路线发布</span></span>
    </h3>
	<div class="qunaertong">
		<!--<iframe name="ifr" style="display:none;"></iframe>-->
		<form action="#" method="post" name="form" enctype="multipart/form-data">
			<p>
				<b class="tit">路线名称:</b>
				<span class="con1"><input type="text" class="inpcon" value="" id="ch_ops" maxlength="4" name="topic"/></span>
				<b class="tit">（最多可输入4个字符）</b>
				
			</p>
			<p>
				<b class="tit">路线描述:</b>
				<span class="con1"><textarea name="content" <textarea name="content"  maxlength="240" style="margin: 0px; width: 301px; height: 212px;"></textarea></textarea></span>
				<b class="tit">（最多可输入240个字符）</b>
			</p>
 
			<p> 
				<input type="submit" class="ok_r" id="Submit" name="action" value="保存" />
				<input type="submit" class="ok_r" id="Submit" name="action" value="发布" />
			</p>
		</form>
	</div> 
</div>
 



